<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="com.sinba.common.dto.PageDTO"%>
<%@page import="com.bill.common.news.dto.NewsQueryDTO"%>
<%@page import="com.bill.common.news.service.INewsService"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
INewsService ns = (INewsService)ac.getBean("newsService");
NewsQueryDTO queryDTO = new NewsQueryDTO();
queryDTO.setNewType((String)request.getParameter("newType"));
queryDTO.setLimit(10);
int pages = 1;
String sidx = "createTime";
String sord="desc";
if(request.getParameter("pages")!=null && request.getParameter("_pages")!=""){
	pages = Integer.parseInt(request.getParameter("pages"));
}
int rows = 8;
int start = ( pages - 1 ) * rows;
queryDTO.setStart( start );
queryDTO.setLimit( rows );
PageDTO pagedto = ns.findNewsPager(queryDTO,sord,sidx);
if(pagedto!=null){
	pagedto.setPage( pages );
	pagedto.setRows( rows );
}
request.setAttribute("newType",(String)request.getParameter("newType"));
request.setAttribute("pageDTO",pagedto);
request.setAttribute("pages",pages);
%>
<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title><fmt:message key="i18n.newsGrid"/>-<fmt:message key="i18n.title"/> </title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" type="text/css" href="css/style.css" />
<link  rel="stylesheet"  href="index/galleria.classic.css"  id="galleria-theme">
<link  rel="Stylesheet"  type="text/css"  href="index/basic.css"  media="all">
<link  rel="Stylesheet"  type="text/css"  href="index/site.css"  media="screen">
<link  rel="Stylesheet"  type="text/css"  href="index/menuHoriz.css"  media="screen">
<link  rel="Stylesheet"  type="text/css"  href="index/menuVert.css"  media="screen">
<link  rel="Stylesheet"  type="text/css"  href="index/menuAccordion.css"  media="screen">
<link  rel="Stylesheet"  type="text/css"  href="index/print.css"  media="print">
<script type="text/javascript" src="scripts/jquery/jquery-1.4.2.min.js"></script>

<script type="text/javascript">
    function setCookie(c_name,value,exdays){
		var exdate=new Date();
		exdate.setDate(exdate.getDate() + exdays);
		var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
		document.cookie=c_name + "=" + c_value;
	}
	function setLanguage(lang){
		setCookie('language',lang,300);
		window.location.reload();
	}
    </script>  
</head>
<body style="height:800px">
<div  id="wrapBackground">
  <div  id="wrapCentering">
    <div  id="wrapHeader">
      <div  id="holderMainLogo">
        <h1> <a  id="ctl00_lnkMainLogo"  href="#"><img  src="index/logo_StepStone.png"  alt="StepStone - Inside Private Markets"  style="border-width:0px;"></a> </h1>
      </div>
      <div  id="holderHeaderNav">
        <div  id="ZHLink">
         <ul  class="listMenuHorizZH">
                  <li  class="menuHoriz_Zh"> 
                  <c:if test="${empty cookie['language'].value or cookie['language'].value eq 'zh_CN'}">
                  	 <a href="javascript:setLanguage('en_US');"  style="background-image: url('index/menuHoriz_zh_CN.gif');">English</a> 
                  </c:if>
                   <c:if test="${cookie['language'].value eq 'en_US'}">
                   	<a href="javascript:setLanguage('zh_CN');"  style="background-image: url('index/menuHoriz_en_US.gif');">English</a>
                   </c:if>
                   </li>
                </ul>
        </div>
        <div  id="mainTopNav">
          <ul  class="listMenuHoriz">
            <li><a href="index.jsp" target="_top" onclick="changeCss()" class="mnCur" ><fmt:message key="i18n.indexPage"/></a></li>
               		<c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="news!newsInfo.action?newsQueryDTO.newType=CompanyProfile" target="main"  <c:if test="${session.location eq '003'}">class="mnCur"</c:if>> <fmt:message key="i18n.companyIntroduction"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="news!newsInfoOut.action?newsQueryDTO.newType=CompanyProfile" > <fmt:message key="i18n.companyIntroduction"/></a></li>
                    </c:if>
                    
                    <c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="news!newsInfo.action?newsQueryDTO.newType=ContactUS" target="main"> <fmt:message key="i18n.ContactOur"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="news!newsInfoOut.action?newsQueryDTO.newType=ContactUS" > <fmt:message key="i18n.ContactOur"/></a></li>
                    </c:if>
                    
                    
                    <c:if test="${empty loginName}">
                   		<li><a href="login.jsp" ><fmt:message key="i18n.login"/></a></li>
                    </c:if>
                    <c:if test="${not empty loginName}">
                    	<li><a href="index_main.html" target="_top"><fmt:message key="i18n.userCenter"/></a></li>
                    </c:if>
                    <c:if test="${fn:contains(curl,'top.jsp')==true}">
               			<li><a href="newsList.jsp?newType=WebNews" target="main"  ><fmt:message key="i18n.news"/></a></li>
               		</c:if>
               		<c:if test="${fn:contains(curl,'top.jsp')==false}">
                    <li><a href="newsList-out.jsp?newType=WebNews"><fmt:message key="i18n.news"/></a></li>
                    </c:if>
          </ul>
        </div>
      </div>
    </div>
    <div  id="ctl00_pnlSectionHeader"  class="holderSectionHeader holderSectionHeader_About">
      <h2> </h2>
    </div>
    <div  id="wrapMainContent_Outer">
      <div  id="wrapMainContent_Inner">
        <div  id="holderPageHeader">
          <h3><fmt:message key="i18n.newsGrid"/></h3>
        </div>
        <div  id="wrapPageContent">
        <br><br><br>
        	<div class="listTable">
	    		<table class="" >
		       		<tr class="ltt">
		       				<th><fmt:message key="i18n.titleChild"/></th>
		       				<th><fmt:message key="i18n.releseTime"/></th>
		       		</tr>
		       		<tbody>
		       			<c:forEach items="${pageDTO.data}" var="data">
		       				<tr>
		       					<td><a href="news!newsInfoOut.action?newsQueryDTO.newId=${data.newId}">${data.title}</a></td>
		       					<td><fmt:formatDate type="date" value="${data.createTime}"  pattern="yyyy-MM-dd HH:mm:ss" /></td>
		       				</tr>
		       			</c:forEach>
		       			<c:if test="${empty pageDTO.data}">
		       				<tr>
		       					<td colspan="5"><fmt:message key="i18n.noData"/>!</td>
		       				</tr>
		       			</c:if>
		       		</tbody>		        		
		       	</table>
	    	</div>
	    	
	    	 <div class="page">
	             <div class="page_r">
	                 <ul>
	                 	 <li><a href="newsList-out.jsp?newType=${newType}&sord=desc&pages=1"><fmt:message key="i18n.firstPage"/></a></li>
	                     <li>
		                     <c:if test="${pageDTO.page!=1}">
				        			<a href="newsList-out.jsp?newType=${newType}&sord=desc&pages=${pageDTO.page-1}"><fmt:message key="i18n.upPage"/></a>
				        	 </c:if>
	                     </li>
	                     <c:if test="${pages < pageDTO.total}">
	                     <c:forEach  var = "li" begin="${pages}" end ="${pages+2}" step ="1"> 
	                     	<li><a href="newsList-out.jsp?newType=${newType}&sord=desc&pages=${li}" <c:if test="${pages eq li}">class="pageCur"</c:if>>${li}</a></li>
	                     </c:forEach>
	                     </c:if>
	                     <li>
							<c:if test="${pageDTO.page+1<=pageDTO.total}">
			        			<a href="newsList-out.jsp?newType=${newType}&sord=desc&pages=${pageDTO.page+1}"><fmt:message key="i18n.nextPage"/></a>
			        		</c:if>
						</li>
	                     <li><a href="newsList-out.jsp?newType=${newType}&sord=desc&pages=${pageDTO.total}"><fmt:message key="i18n.endPage"/></a></li>
	                     <li><a href="#"><fmt:message key="i18n.nowPage"/>:${pageDTO.page}/${pageDTO.total}
	                     -<fmt:message key="i18n.total"/>${pageDTO.totalSize}<fmt:message key="i18n.tiao"/>
	                     </a>
	                 </ul>
	             </div>
	         </div>
        
        </div>
      </div>
    </div>
    <div  id="ctl00_wrapContentFooter"  class="wrapContentFooter"> <a  id="ctl00_lnkClientLogIn"  class="linkClientLogIn"  href="login.jsp"  target="_blank">客户登陆</a> </div>
    <div  id="wrapFooter">
     <div  id="locationsFooter">
             <ul  id="locationsFooterContacts">
                <ul>
                 <li><a href="https://www.tenpay.com" target="_blank"><fmt:message key="i18n.caifutong" /></a></li>
	    		<li><a href="https://www.alipay.com/" target="_blank"><fmt:message key="i18n.zhifubao" /></a></li>
	    		<li><a href="http://www.abchina.com/cn/" target="_blank"><fmt:message key="i18n.zhifubao" /></a></li>
	    		<li><a href="http://www.psbc.com" target="_blank"><fmt:message key="i18n.emsBank" /></a></li>
	    		<li><a href="http://www.icbc.com.cn" target="_blank"><fmt:message key="i18n.gongBank" /></a></li>
	    		
	    		<li><a href="http://www.ccb.com" target="_blank"><fmt:message key="i18n.ccbBank" /></a></li>
	            <li><a href="http://www.bankcomm.com" target="_blank"><fmt:message key="i18n.jiaoBank" /></a></li>
	            <li><a href="http://www.spdb.com.cn" target="_blank"><fmt:message key="i18n.pufaBank" /></a></li>
	            <li><a href="http://www.boc.cn/" target="_blank"><fmt:message key="i18n.chinaBank" /></a></li>
	            <li><a href="http://bank.ecitic.com/" target="_blank"><fmt:message key="i18n.zhongxinBank" /></a></li>
	    		
                </ul>
              </ul>
            </div>
      <br>
            <!-- <div  id="holderFooterLeft">
              <ul  id="listFooterNav">
                <li> <a  id="lnkFooterSiteMap"  href="#">站点导航</a> <span>|</span> </li>
                <li> <a  id="lnkFooterTermsOfUse"  href="#">使用条款</a> <span>|</span> </li>
                <li> <a  id="lnkFooterPrivacyPolicy"  href="#">隐私政策</a> </li>
              </ul>
            </div> -->
            <br>
            <div  id="holderFooterRight">
              <p> Copyright &#169; 2014   <a  href="#"  target="_blank">浙ICP备14900333号</a></p>
            </div>
    </div>
  </div>
</div>
</body>
</html>